<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>

    <t:saveState value="#{FileUploadAgent.name}"/>

    <h:panelGroup id="body">

        <h:messages id="messageList" showSummary="true" />


        <h:form id="form1" enctype="multipart/form-data" >
        <h:outputText value=""/>
            <h:outputText value="1 "/>
            <t:inputFileUpload id="fileupload"
                               accept="image/*"
                               value="#{FileUploadAgent.upFile}"
                               storage="file"
                               styleClass="fileUploadInput"
                               required="true"
                               maxlength="200000"/>
            <h:message for="fileupload" showDetail="true" />
            <h:outputText value="2"/>
            <h:inputText value="#{FileUploadAgent.name}"/>
            <h:commandButton value="3" action="#{FileUploadAgent.upload}" />
        </h:form>

        <h:panelGrid columns="1" rendered="#{FileUploadAgent.uploaded}">
            <h:outputText value="4" />
            <h:graphicImage url="ShowImg"/>
            <h:outputText value="#{FileUploadAgent.name}"/>
            <h:outputText value="5" />
            <h:outputLink value="ShowImg">
                <f:param name="allowCache" value="true"/>
                <f:param name="openDirectly" value="false"/>
                <h:outputText value="6"/>
            </h:outputLink>
            <h:outputText value="7" />
            <h:outputLink value="ShowImg">
                <f:param name="allowCache" value="true"/>
                <f:param name="openDirectly" value="true"/>
                <h:outputText value="8"/>
            </h:outputLink>
        </h:panelGrid>


    </h:panelGroup>



</f:view>
    
</ui:composition>
